package com.jt.common.Collection;

import java.util.concurrent.ArrayBlockingQueue;

public class BlockQueueTests {
    public static void main(String[] args) throws InterruptedException {
        ArrayBlockingQueue<Integer> bq =
                new ArrayBlockingQueue<>(3);
        bq.put(100);
        bq.put(200);
        bq.put(300);
        System.out.println(bq);
        bq.take();
        bq.take();
        bq.take();
        System.out.println(bq);
        bq.take();//取不到数据，被阻塞了
        System.out.println(bq);
    }
}
